import 'package:flutter/material.dart';
class BottomNavigationDemo extends StatefulWidget{
  @override
  State<StatefulWidget> createState() {
    // TODO: implement createState
    return _BottomNavigationState();
  }
}
class _BottomNavigationState extends State<BottomNavigationDemo>{
  void _onBottomNavigationBarClick(int index){
    setState(() {
      _defaultIndex=index;
    });
  }
  int _defaultIndex=0;
  @override
  Widget build(BuildContext context) {
    // TODO: implement build
    return BottomNavigationBar(
      type:BottomNavigationBarType.fixed ,
      onTap: _onBottomNavigationBarClick,
      currentIndex: _defaultIndex,
      items: [
        BottomNavigationBarItem(
            title: Text("Explore"),
            icon: Icon(Icons.explore)
        ),
        BottomNavigationBarItem(
            title: Text("History"),
            icon: Icon(Icons.history)
        ),
        BottomNavigationBarItem(
            title: Text("List"),
            icon: Icon(Icons.list)
        ),
        BottomNavigationBarItem(
            title: Text("My"),
            icon: Icon(Icons.person)
        ),
      ],
    );
  }
}